package data;

import java.util.Date;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class HouseKeepingUser extends AbstractData{
	private long id = -1;
	private long hotelId = -1;
	private String firstName;
	private String lastName;
	private String address;
	private String country;
	private String state;
	private String city;
	private String zipCode;
	private String phone;
	private String mobile;
	private String emergencyNumber;
	private String gender;
	private Date birthday;
	private String identificationNo;
	private String passportNumber;
	private String driverLicense;
	private String socialSecurityCard;
	private String bloodGroup;
	private String designation;
	private Date dateOfJoin;
	private boolean status;
	private boolean avaliable;
	
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getHotelId() {
		return hotelId;
	}

	public void setHotelId(long hotelId) {
		this.hotelId = hotelId;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zipCode) {
		this.zipCode = zipCode;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmergencyNumber() {
		return emergencyNumber;
	}

	public void setEmergencyNumber(String emergencyNumber) {
		this.emergencyNumber = emergencyNumber;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getIdentificationNo() {
		return identificationNo;
	}

	public void setIdentificationNo(String identificationNo) {
		this.identificationNo = identificationNo;
	}

	public String getPassportNumber() {
		return passportNumber;
	}

	public void setPassportNumber(String passportNumber) {
		this.passportNumber = passportNumber;
	}

	public String getDriverLicense() {
		return driverLicense;
	}

	public void setDriverLicense(String driverLicense) {
		this.driverLicense = driverLicense;
	}

	public String getSocialSecurityCard() {
		return socialSecurityCard;
	}

	public void setSocialSecurityCard(String socialSecurityCard) {
		this.socialSecurityCard = socialSecurityCard;
	}

	public String getBloodGroup() {
		return bloodGroup;
	}

	public void setBloodGroup(String bloodGroup) {
		this.bloodGroup = bloodGroup;
	}

	public String getDesignation() {
		return designation;
	}

	public void setDesignation(String designation) {
		this.designation = designation;
	}

	public Date getDateOfJoin() {
		return dateOfJoin;
	}

	public void setDateOfJoin(Date dateOfJoin) {
		this.dateOfJoin = dateOfJoin;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public boolean isAvaliable() {
		return avaliable;
	}

	public void setAvaliable(boolean avaliable) {
		this.avaliable = avaliable;
	}

	@Override
	public Entity getEntity() {
		Entity item;
		if(this.key == null)
			item = new Entity(EntityName.HouseKeepingUser);
		else
			item = new Entity(this.key);
		item.setProperty("hotelId",this.hotelId);
		item.setProperty("firstName", this.firstName);
		item.setProperty("lastName", this.lastName);
		item.setProperty("address", this.address);
		item.setProperty("country", this.country);
		item.setProperty("state", this.state);
		item.setProperty("city", this.city);
		item.setProperty("zipCode", this.zipCode);
		item.setProperty("phone", this.phone);
		item.setProperty("mobile", this.mobile);
		item.setProperty("emergencyNumber", this.emergencyNumber);
		item.setProperty("gender", this.gender);
		item.setProperty("birthday", this.birthday);
		item.setProperty("identificationNo", this.identificationNo);
		item.setProperty("passportNumber", this.passportNumber);
		item.setProperty("driverLicense", this.driverLicense);
		item.setProperty("socialSecurityCard", this.socialSecurityCard);
		item.setProperty("bloodGroup", this.bloodGroup);
		item.setProperty("designation", this.designation);
		item.setProperty("dateOfJoin", this.dateOfJoin);
		item.setProperty("status", this.status);
		item.setProperty("avaliable", this.avaliable);
		return item;
	}
	@Override
	public void setEntity(Entity entity) {
		this.id = entity.getKey().getId();
		this.hotelId = (Long) entity.getProperty("hotelId");
		this.firstName = (String) entity.getProperty("firstName");
		this.lastName = (String) entity.getProperty("lastName");
		this.address = (String) entity.getProperty("address");
		this.country = (String) entity.getProperty("country");
		this.state = (String) entity.getProperty("state");
		this.city = (String) entity.getProperty("city");
		this.zipCode = (String) entity.getProperty("zipCode");
		this.phone = (String) entity.getProperty("phone");
		this.mobile = (String) entity.getProperty("mobile");
		this.emergencyNumber = (String) entity.getProperty("emergencyNumber");
		this.gender = (String) entity.getProperty("gender");
		this.birthday = (Date) entity.getProperty("birthday");
		this.identificationNo = (String) entity.getProperty("identificationNo");
		this.passportNumber =(String) entity.getProperty("passportNumber");
		this.driverLicense=(String) entity.getProperty("driverLicense");
		this.socialSecurityCard=(String) entity.getProperty("socialSecurityCard");
		this.bloodGroup = (String) entity.getProperty("bloodGroup");
		this.designation = (String) entity.getProperty("designation");
		this.dateOfJoin = (Date) entity.getProperty("dateOfJoin");
		this.status = (Boolean) entity.getProperty("status");
		this.avaliable = (Boolean) entity.getProperty("avaliable");
		this.key = entity.getKey();
	}

	public void LoadData() {
		if (this.id > -1) {
			Entity entity = LoadData(EntityName.HouseKeepingUser, this.id);
			setEntity(entity);
		}
	}
}
